package com.springboot.frame.oauth.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springboot.frame.oauth.server.model.SysRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author liheng
 * @since 2020-08-26
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {
    /**
     * 根据uid查询用户拥有的角色
     *
     * @param uid
     * @return
     */
    List<SysRole> selectSysRolesByUid(@Param("uid") Integer uid);

    /**
     * @param username
     * @return
     */
    List<String> selectRoleNameByUsername(String username);


    /**
     * 根据角色集合查询资源
     *
     * @param rid
     * @return
     */
    List<Integer> selectSysResByRid(@Param("rid") Integer rid);
}
